<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>v-bind动态绑定style(对象语法)</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
<app id="app">
    <!-- <h2 :style="{key(属性名):value(属性值)}">{{message}}</h2> -->
    <!-- 加单引号，当成字符串解析 -->
    <h2 :style="{fontSize:'50px'}">{{message}}</h2>
    <!-- 不加单引号，变量解析 -->
    <h2 :style="{fontSize:fontSize}">{{message}}</h2>
    <h2 :style="getStyle()">{{message}}</h2>
</app>
</body>
<script>
    const app = new Vue({
        el:"#app",
        data:{
            message:"你好啊",
            fontSize:'100px'
        },
        methods: {
            getStyle(){
                return {fontSize:this.fontSize}
            }
        }
    });
</script>
</html>